package com.hncc.sms.domain;

import java.util.Date;

import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 用户信息对象 sys_user
 * 
 * @author ruoyi
 * @date 2020-08-10
 */
@ApiModel(value = "用户信息实体")
public class SysUserManager extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 用户ID */
    @ApiModelProperty(value = "用户ID",required = false)
    @Excel(name = "用户ID")
    private Long userId;

    /** 科室 */
    @ApiModelProperty(value = "科室",required = false)
    @Excel(name = "科室")
    private Long deptId;

    /** 用户名 */
    @ApiModelProperty(value = "用户名",required = false)
    @Excel(name = "用户名")
    private String userName;

    /** 真实姓名 */
    @ApiModelProperty(value = "真实姓名",required = false)
    @Excel(name = "真实姓名")
    private String nickName;

    /** 用户类型（00系统用户） */
    @ApiModelProperty(value = "用户类型（00系统用户）",required = false)
    private String userType;

    /** 用户邮箱 */
    @ApiModelProperty(value = "用户邮箱",required = false)
    private String email;

    /** 手机号码 */
    @ApiModelProperty(value = "手机号码",required = false)
    private String phonenumber;

    /** 用户性别（0男 1女 2未知） */
    @ApiModelProperty(value = "用户性别（0男 1女 2未知）",required = false)
    private String sex;

    /** 头像地址 */
    @ApiModelProperty(value = "头像地址",required = false)
    private String avatar;

    /** 密码 */
    @ApiModelProperty(value = "密码",required = false)
    private String password;

    /** 帐号状态（0正常 1停用） */
    @ApiModelProperty(value = "帐号状态（0正常 1停用）",required = false)
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    @ApiModelProperty(value = "删除标志（0代表存在 2代表删除）",required = false)
    private String delFlag;

    /** 最后登陆IP */
    @ApiModelProperty(value = "最后登陆IP",required = false)
    private String loginIp;

    /** 最后登陆时间 */
    @ApiModelProperty(value = "最后登陆时间",required = false)
    private Date loginDate;

    /** 是否参与排班：0-&gt;否;1-&gt;是 */
    @ApiModelProperty(value = "是否参与排班：0-&gt;否;1-&gt;是",required = false)
    private Integer skdFlag;

    /** 职称 */
    @ApiModelProperty(value = "职称",required = false)
    private String title;

    /** 挂号级别id,1-&gt;专家,2-&gt;普通,3-&gt;急诊 */
    @ApiModelProperty(value = "挂号级别id,1-&gt;专家,2-&gt;普通,3-&gt;急诊",required = false)
    private Long registrationRankId;

    /**角色id */
    private Long roleId;

    /** 角色IDs */
    private Long[] roleIds;

    /** 角色实体类 */
    private SysRoleManager sysRoleManager;

    /** 科室实体类 */
    private SysDeptManager sysDeptManager;

    public boolean isAdmin()
    {
        return isAdmin(this.userId);
    }
    public static boolean isAdmin(Long userId)
    {
        return userId != null && 1L == userId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long[] getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(Long[] roleIds) {
        this.roleIds = roleIds;
    }

    public SysRoleManager getSysRoleManager() {
        return sysRoleManager;
    }

    public void setSysRoleManager(SysRoleManager sysRoleManager) {
        this.sysRoleManager = sysRoleManager;
    }

    public SysDeptManager getSysDeptManager() {
        return sysDeptManager;
    }

    public void setSysDeptManager(SysDeptManager sysDeptManager) {
        this.sysDeptManager = sysDeptManager;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setDeptId(Long deptId) 
    {
        this.deptId = deptId;
    }

    public Long getDeptId() 
    {
        return deptId;
    }
    public void setUserName(String userName) 
    {
        this.userName = userName;
    }

    public String getUserName() 
    {
        return userName;
    }
    public void setNickName(String nickName) 
    {
        this.nickName = nickName;
    }

    public String getNickName() 
    {
        return nickName;
    }
    public void setUserType(String userType) 
    {
        this.userType = userType;
    }

    public String getUserType() 
    {
        return userType;
    }
    public void setEmail(String email) 
    {
        this.email = email;
    }

    public String getEmail() 
    {
        return email;
    }
    public void setPhonenumber(String phonenumber) 
    {
        this.phonenumber = phonenumber;
    }

    public String getPhonenumber() 
    {
        return phonenumber;
    }
    public void setSex(String sex) 
    {
        this.sex = sex;
    }

    public String getSex() 
    {
        return sex;
    }
    public void setAvatar(String avatar) 
    {
        this.avatar = avatar;
    }

    public String getAvatar() 
    {
        return avatar;
    }
    public void setPassword(String password) 
    {
        this.password = password;
    }

    public String getPassword() 
    {
        return password;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }
    public void setLoginIp(String loginIp) 
    {
        this.loginIp = loginIp;
    }

    public String getLoginIp() 
    {
        return loginIp;
    }
    public void setLoginDate(Date loginDate) 
    {
        this.loginDate = loginDate;
    }

    public Date getLoginDate() 
    {
        return loginDate;
    }
    public void setSkdFlag(Integer skdFlag) 
    {
        this.skdFlag = skdFlag;
    }

    public Integer getSkdFlag() 
    {
        return skdFlag;
    }
    public void setTitle(String title) 
    {
        this.title = title;
    }

    public String getTitle() 
    {
        return title;
    }
    public void setRegistrationRankId(Long registrationRankId) 
    {
        this.registrationRankId = registrationRankId;
    }

    public Long getRegistrationRankId() 
    {
        return registrationRankId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("deptId", getDeptId())
            .append("userName", getUserName())
            .append("nickName", getNickName())
            .append("userType", getUserType())
            .append("email", getEmail())
            .append("phonenumber", getPhonenumber())
            .append("sex", getSex())
            .append("avatar", getAvatar())
            .append("password", getPassword())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("loginIp", getLoginIp())
            .append("loginDate", getLoginDate())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("skdFlag", getSkdFlag())
            .append("title", getTitle())
            .append("registrationRankId", getRegistrationRankId())
            .toString();
    }
}
